#include "gtest/gtest.h"

// skip test
TEST(SkipTest, DoesSkip) {
    GTEST_SKIP() << "Skipping single test";
    EXPECT_EQ(0, 1);  // Won't fail; it won't be executed
}

class SkipFixture : public ::testing::Test {
protected:
    void SetUp() override {
        GTEST_SKIP() << "Skipping all tests for this fixture";
    }
};

// Tests for SkipFixture won't be executed.
TEST_F(SkipFixture, SkipsOneTest) {
    EXPECT_EQ(5, 7);  // Won't fail
}


// sub-routine trace
int Bar(int n) {
    return 0; // Bar(1) != 1 and Bar(9) != 1
}

void Sub1(int n) {
    EXPECT_EQ(Bar(n), 1);
    EXPECT_EQ(Bar(n + 1), 2);
}

TEST(AdvencedUsageTest, ScopedTrace) {
    {
       //SCOPED_TRACE("A");  // This trace point will be included in
                           // every failure in this scope.
       Sub1(1);
     }
      // Now it won't.
      Sub1(9);
}

// Logging Additional Information
TEST(AdvencedUsageTest, AddtionalInformation) {
    ::testing::Test::RecordProperty("CurrentTime", "unknown");
    EXPECT_EQ(1, 1);
}